<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qtextlayout.cpp -->
  <title>QTextInlineObject Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QTextInlineObject</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QTextInlineObject Class</h1>
<!-- $$$QTextInlineObject-brief -->
<p>The QTextInlineObject class represents an inline object in a <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a> and its implementations. <a href="#details">More...</a></p>
<!-- @@@QTextInlineObject -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QTextInlineObject&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr></table></div><ul>
<li><a href="qtextinlineobject-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are <a href="../qtdoc/threads-reentrancy.html">reentrant</a>.</p>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#ascent">ascent</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#descent">descent</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextFormat </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#format">format</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#formatIndex">formatIndex</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#height">height</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#isValid">isValid</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#rect">rect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#setAscent">setAscent</a></b>(qreal <i>a</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#setDescent">setDescent</a></b>(qreal <i>d</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#setWidth">setWidth</a></b>(qreal <i>w</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::LayoutDirection </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#textDirection">textDirection</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#textPosition">textPosition</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextinlineobject.html#width">width</a></b>() const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QTextInlineObject-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>Normally, you do not need to create a QTextInlineObject. It is used by <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a> to handle inline objects when implementing a custom layout.</p>
<p>The inline object has various attributes that can be set, for example using, <a href="qtextinlineobject.html#setWidth">setWidth</a>(), <a href="qtextinlineobject.html#setAscent">setAscent</a>(), and <a href="qtextinlineobject.html#setDescent">setDescent</a>(). The rectangle it occupies is given by <a href="qtextinlineobject.html#rect">rect</a>(), and its direction by <a href="qtextinlineobject.html#textDirection">textDirection</a>(). Its position in the text layout is given by <a href="qtextinlineobject.html#textPosition">textPosition</a>(), and its format is given by <a href="qtextinlineobject.html#format">format</a>().</p>
</div>
<!-- @@@QTextInlineObject -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$ascent[overload1]$$$ascent -->
<h3 class="fn" id="ascent"><a name="ascent"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextInlineObject::<span class="name">ascent</span>() const</h3>
<p>Returns the inline object's ascent.</p>
<p><b>See also </b><a href="qtextinlineobject.html#setAscent">setAscent</a>(), <a href="qtextinlineobject.html#descent">descent</a>(), <a href="qtextinlineobject.html#width">width</a>(), and <a href="qtextinlineobject.html#rect">rect</a>().</p>
<!-- @@@ascent -->
<!-- $$$descent[overload1]$$$descent -->
<h3 class="fn" id="descent"><a name="descent"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextInlineObject::<span class="name">descent</span>() const</h3>
<p>Returns the inline object's descent.</p>
<p><b>See also </b><a href="qtextinlineobject.html#setDescent">setDescent</a>(), <a href="qtextinlineobject.html#ascent">ascent</a>(), <a href="qtextinlineobject.html#width">width</a>(), and <a href="qtextinlineobject.html#rect">rect</a>().</p>
<!-- @@@descent -->
<!-- $$$format[overload1]$$$format -->
<h3 class="fn" id="format"><a name="format"></a><span class="type"><a href="qtextformat.html">QTextFormat</a></span> QTextInlineObject::<span class="name">format</span>() const</h3>
<p>Returns format of the inline object within the text layout.</p>
<!-- @@@format -->
<!-- $$$formatIndex[overload1]$$$formatIndex -->
<h3 class="fn" id="formatIndex"><a name="formatIndex"></a><span class="type">int</span> QTextInlineObject::<span class="name">formatIndex</span>() const</h3>
<p>Returns an integer describing the format of the inline object within the text layout.</p>
<!-- @@@formatIndex -->
<!-- $$$height[overload1]$$$height -->
<h3 class="fn" id="height"><a name="height"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextInlineObject::<span class="name">height</span>() const</h3>
<p>Returns the inline object's total height. This is equal to <a href="qtextinlineobject.html#ascent">ascent</a>() + <a href="qtextinlineobject.html#descent">descent</a>() + 1.</p>
<p><b>See also </b><a href="qtextinlineobject.html#ascent">ascent</a>(), <a href="qtextinlineobject.html#descent">descent</a>(), <a href="qtextinlineobject.html#width">width</a>(), and <a href="qtextinlineobject.html#rect">rect</a>().</p>
<!-- @@@height -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn" id="isValid"><a name="isValid"></a><span class="type">bool</span> QTextInlineObject::<span class="name">isValid</span>() const</h3>
<p>Returns <code>true</code> if this inline object is valid; otherwise returns false.</p>
<!-- @@@isValid -->
<!-- $$$rect[overload1]$$$rect -->
<h3 class="fn" id="rect"><a name="rect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QTextInlineObject::<span class="name">rect</span>() const</h3>
<p>Returns the inline object's rectangle.</p>
<p><b>See also </b><a href="qtextinlineobject.html#ascent">ascent</a>(), <a href="qtextinlineobject.html#descent">descent</a>(), and <a href="qtextinlineobject.html#width">width</a>().</p>
<!-- @@@rect -->
<!-- $$$setAscent[overload1]$$$setAscentqreal -->
<h3 class="fn" id="setAscent"><a name="setAscent"></a><span class="type">void</span> QTextInlineObject::<span class="name">setAscent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>a</i>)</h3>
<p>Sets the inline object's ascent to <i>a</i>.</p>
<p><b>See also </b><a href="qtextinlineobject.html#ascent">ascent</a>(), <a href="qtextinlineobject.html#setDescent">setDescent</a>(), <a href="qtextinlineobject.html#width">width</a>(), and <a href="qtextinlineobject.html#rect">rect</a>().</p>
<!-- @@@setAscent -->
<!-- $$$setDescent[overload1]$$$setDescentqreal -->
<h3 class="fn" id="setDescent"><a name="setDescent"></a><span class="type">void</span> QTextInlineObject::<span class="name">setDescent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>d</i>)</h3>
<p>Sets the inline object's descent to <i>d</i>.</p>
<p><b>See also </b><a href="qtextinlineobject.html#descent">descent</a>(), <a href="qtextinlineobject.html#setAscent">setAscent</a>(), <a href="qtextinlineobject.html#width">width</a>(), and <a href="qtextinlineobject.html#rect">rect</a>().</p>
<!-- @@@setDescent -->
<!-- $$$setWidth[overload1]$$$setWidthqreal -->
<h3 class="fn" id="setWidth"><a name="setWidth"></a><span class="type">void</span> QTextInlineObject::<span class="name">setWidth</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>)</h3>
<p>Sets the inline object's width to <i>w</i>.</p>
<p><b>See also </b><a href="qtextinlineobject.html#width">width</a>(), <a href="qtextinlineobject.html#ascent">ascent</a>(), <a href="qtextinlineobject.html#descent">descent</a>(), and <a href="qtextinlineobject.html#rect">rect</a>().</p>
<!-- @@@setWidth -->
<!-- $$$textDirection[overload1]$$$textDirection -->
<h3 class="fn" id="textDirection"><a name="textDirection"></a><span class="type"><a href="../qtcore/qt.html#LayoutDirection-enum">Qt::LayoutDirection</a></span> QTextInlineObject::<span class="name">textDirection</span>() const</h3>
<p>Returns if the object should be laid out right-to-left or left-to-right.</p>
<!-- @@@textDirection -->
<!-- $$$textPosition[overload1]$$$textPosition -->
<h3 class="fn" id="textPosition"><a name="textPosition"></a><span class="type">int</span> QTextInlineObject::<span class="name">textPosition</span>() const</h3>
<p>The position of the inline object within the text layout.</p>
<!-- @@@textPosition -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn" id="width"><a name="width"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextInlineObject::<span class="name">width</span>() const</h3>
<p>Returns the inline object's width.</p>
<p><b>See also </b><a href="qtextinlineobject.html#setWidth">setWidth</a>(), <a href="qtextinlineobject.html#ascent">ascent</a>(), <a href="qtextinlineobject.html#descent">descent</a>(), and <a href="qtextinlineobject.html#rect">rect</a>().</p>
<!-- @@@width -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
